/**
 * @param {number[]} nums
 * @param {number} target
 * @return {number}
 */
var searchInsert = function (nums, target) {
  const index = nums.findIndex((e) => e >= target);

  return index == -1 ? nums.length : index;
};
